﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;




namespace DropletArenaDisplay
{

    public partial class ControlForm : Form
    {
        public ControlForm()
        {
            InitializeComponent();
        }



        private void fileQuit_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void fileOpen_Click(object sender, EventArgs e)
        {
            openFD.InitialDirectory = "C:";
            openFD.Title = "Choose an image";
            openFD.FileName = "";
            openFD.Filter = "Bitmaps|*.bmp";
            openFD.ShowDialog();
            string Chosen_File = "";

            if (openFD.ShowDialog() == DialogResult.Cancel)
            {
                MessageBox.Show("Operation Cancelled");
            }

            else
            {
                Chosen_File = openFD.FileName;
                pictureBox1.Image = Image.FromFile(Chosen_File);

            }
        }


        private void showOnMonitor(int showOnMonitor) //helps control which monitor the display form appears on
        { 
            Screen[] sc; 
            sc = Screen.AllScreens; 
            //get all the screen width and heights 
            Form2 f = new Form2(); 
            f.FormBorderStyle = FormBorderStyle.None; 
            f.Left = sc[showOnMonitor].Bounds.Left; 
            f.Top = sc[showOnMonitor].Bounds.Top; 
            f.StartPosition = FormStartPosition.Manual; 
            f.Show();
            f.pictureBox1.Image = this.pictureBox1.Image;
        }



        private void bttnOpenDisplay_Click(object sender, EventArgs e)
        {
            showOnMonitor(1); //indexing begins at 0
         }

        private void menuView_Click(object sender, EventArgs e)
        {

        }

        private void viewFullScreen_Click(object sender, EventArgs e)
        {

        }

    }
}

